import { createStore } from "vuex"

// import user from "./modules/user"
// import app from "./modules/app"
const modulesFiles = import.meta.glob('./modules/*.js', {
    eager: true,
    import: 'default'
})
//遍历modulesFiles,得到modules对象
// console.log('moduleFiles', modulesFiles);
let modules = {}
for (let key in modulesFiles) {
    const arr = key.split('/');
    const name = arr[arr.length - 1].split('.')[0];
    modules[name] = modulesFiles[key];
}
// console.log('modules', modules);



const store = createStore({
    modules,
})


export default store
